package com.poem.mapper;

import com.poem.annotation.AutoFill;
import com.poem.dto.LoginDTO;
import com.poem.entity.Users;
import com.poem.enumeration.OperationType;
import com.poem.vo.LoginInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @ClassName: AuthMapper
 * @Author: YLY
 * @Description:
 * @Date: 2025/10/21
 * @Version: 1.0
 */
@Mapper
public interface AuthMapper {

    String getUserByUsername(String username);

    @Select("select * from users where username = #{username}")
    Users getUserByUsernameAll(String username);

    @Delete("delete from users where username = #{username}")
    void deleteUser(String username);

    @AutoFill(value = OperationType.INSERT)
    void addUser(Users user);

    Users getCurrentUser(Long id);
}